/*=============================================================================
    test/test-widget.js
    Copyright (C) 2008-2009, Donald W. Griffin
    All rights reserved.
    [MIT license :: see license.txt for details]
=============================================================================*/

var foo = { bar : { y:42, sub: { s : "xyzzy" } }};

gTests.push
(
    function ()
    {
        var s = "grid widget=foo@foo.bar t=true f=false fufu pi=3.14 x=4 z=@foo.bar.y fifi";
        var decl = jibits.parseWidgetDecl(s);

        assertEquals("grid fufu fifi", decl.fixed);
        assertTrue(foo === decl.type);
        assertEquals(3.14, decl.attrs.pi);
        assertEquals(4, decl.attrs.x);
        assertEquals(foo.bar.sub.s, decl.attrs.sub.s);
        assertEquals(foo.bar.y, decl.attrs.y);
        assertEquals(foo.bar.y, decl.attrs.z);
        assertTrue(decl.attrs.t);
        assertFalse(decl.attrs.f);
    },

    function () { } // end of list
);
